package com.wjm.androidnetproclient.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class Person implements Parcelable {
    private int _id;
    private String name;
    private int age;
    private String sex;
    private String address;

    public Person() {
    }

    public Person(int _id, String name, int age, String sex, String address) {
        this._id = _id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.address = address;
    }

    protected Person(Parcel in) {
        _id = in.readInt();
        name = in.readString();
        age = in.readInt();
        sex = in.readString();
        address = in.readString();
    }

    public static final Creator<Person> CREATOR = new Creator<Person>() {
        @Override
        public Person createFromParcel(Parcel in) {
            return new Person(in);
        }

        @Override
        public Person[] newArray(int size) {
            return new Person[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(_id);
        parcel.writeString(name);
        parcel.writeInt(age);
        parcel.writeString(sex);
        parcel.writeString(address);
    }
}
